package com.aaa.controller;

import com.aaa.entity.ContractLease;
import com.aaa.entity.Result;
import com.aaa.query.ContractQuery;
import com.aaa.service.IContractLeaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author auto
 * @since 2021-01-25
 */
@RestController
@RequestMapping("/leasePrivate")
public class ContractLeasePrivateController {

    @Autowired
    IContractLeaseService service;


    /**
     *  自有资产租出合同 查询所有
     * @return  service.listAllPrivate()
     */

    @RequestMapping("/listAll")
    public Result listAllPrivate(){

        return service.listAllPrivate();
    }

    /**
     *  自有资产租出合同 添加合同
     * @param contract
     */

    @RequestMapping("/add")
    public Result addLeasePrivate(@RequestBody ContractLease contract){

        return service.addLeasePrivate(contract);
    }

    /**
     *  自有资产租出合同 修改合同
     * @param contract
     */

    @RequestMapping("/update")
    public Result updateLeasePrivate(@RequestBody ContractLease contract){

        return service.updateLease(contract);
    }

    /**
     *  自有资产租出合同 分页+模糊查询
     * @param  query
     * @return
     */

    @PostMapping("/query")
    public Result LeasePrivateQuery(@RequestBody ContractQuery query){

    return service.LeasePrivateQuery(query);

    }



}

